package com.qingzhuge.netty;

import com.qingzhuge.netty.server.NettyServer;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.Bean;

/**
 * @author : zero.xiao
 * @description :
 * @date :2018/9/28 0028 下午 14:46
 * @since : 1.0.0
 * @modified :
 */
@SpringBootApplication(scanBasePackages = {"com.qingzhuge"})
public class NettyServerApplication implements CommandLineRunner{

    public static void main(String[] args) {
		SpringApplicationBuilder builder = new SpringApplicationBuilder(NettyServerApplication.class);
		builder.web(WebApplicationType.NONE);
		builder.run(args);
    }
    
    @Bean
    public NettyServer nettyServer() {
    	return new NettyServer();
    }

	@Override
	public void run(String... args) {
		nettyServer().start();
	}
}